IRIT2RAY

Section: RAYSHADE (-)
Updated: IRIT
Index Return to Main Contents

 6 "IRIT Version 6.0"   

NAME

IRIT2RAY - IRIT To RAYSHADE filter

 

Command line options


  irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
           [-f PolyOpti SampPerCrv] [-o OutName] [-g] [-p Zmin Zmax] [-P]
           [-M] [-T] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles

-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough. -4: Four - Generates four polygons per flat patch. Default is 2. -G GridSize: Usually objects are grouped as lists of polygons. This flags will coerce the usage of the RAYSHADE grid structure, with GridSize being used as the grid size along the object bounding box's largest dimension. -F PolygonOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4. -f PolyOpti SampPerCrv: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. Otherwise, an adaptive subdivision that optimizes the samples is employed. -o OutName: Name of output file. By default the name of the first data file from the DFiles list is used. See below on the output files. -g: Generates the geometry file only. See below. -p Zmin Zmax: Sets the ratios between the depth cue and the width of the dumped polylines. See also -P. Closer lines will be drawn wider. -P: Forces dumping polygons as polylines with thickness controlled by -p. -M: If -P (see -P and -p) then converts the control mesh/polygon to polylines which are represented as a sequence of truncated cones. -T: Talkative mode. Prints processing information. -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per surface/trivariate, per direction. If #VIso or #WIso is not specified, #UIso is used for #VIso etc. -s ObjSeq#: Sets object sequence number if no object name. Default 1. -z: Prints version number and current defaults.

 

Usage

Irit2Ray converts freeform surfaces into polygons in a format that can be used by the RAYSHADE ray tracing program. Two files are created, one with a '.geom' extension and one with '.ray'. Since the number of polygons can be extremely large, the geometry is isolated in the '.geom' file and is included (via '#include') in the main '.ray' file. The latter holds the surface properties for all the geometry as well as viewing and RAYSHADE specific commands. This allows for the changing of the shading or the viewing properties while editing small ('.ray') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.ray' file.

In practice, it may be useful to create a low resolution approximation of the model, change the viewing/shading parameters in the '.ray' file until a good view and/or surface quality is found, and then run Irit2Ray once more to create a high resolution approximation of the geometry using '-g'.

Example:


 irit2ray -l -F 0 8 b58.dat

creates b58.ray and b58.geom with low resolution (FineNess of 5). At such low resolution it can very well may happen that triangles will have normals "over the edge" since a single polygon may approximate a highly curved surface. That will cause RAYSHADE to issue an "Inconsistent triangle normals" warning. This problem will not exist if high fineness is used. One can ray trace this scene using a command similar to:


 RAYSHADE -p -W 256 256 b58.ray > b58.rle

Once done with parameter setting for RAYSHADE, a fine approximation of the model can be created with:


 irit2ray -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

Interesting effects can be created using the depth cue support and polyline conversion of irit2ray. For example


 irit2ray -G 5 -P -p -0.0 0.5 solid1.dat

will dump solid1 as a set of polylines (represented as truncated cones in RAYSHADE) with varying thickness according to the z depth. Another example is


 irit2ray -G 5 -P -p -0.1 1.0 saddle.dat

which dumps the isolines extracted from the saddle surface with varying thickness.

Each time a data file is saved in IRIT, it can be saved with the viewing matrix of the last INTERACT by saving the VIEW_MAT object as well. I.e.:


 save( "b58", b58 );

However one can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by the display devices:


 os2drvs b58.dat
 irit2ray -l -F 0 16 b58.dat irit.mat

where irit.mat is the viewing matrix created by os2drvs. The output name, by default, is the last input file name, so you might want to provide an explicit name with the -o flag.

 

Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Ray and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only.

Example:


 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The rectangle can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the patch center. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces bu setting "twoperflat" or "fourperflat".

RAYSHADE specific properties are controlled via the following attributes: "specpow", "reflect", "transp", "body", "index", and "texture". The value of this attributes must be strings as it is copied verbatim. Refer to RAYSHADE's manual for their meaning.

Example:


 attrib( legs, "transp", "0.3" );
 attrib( legs, "texture", "wood,2" );
 attrib( table, "texture", "marble" );
 attrib( table, "reflect", "0.5" );

Optional scale can be prescribed to textures. In the above example wooden legs' (that are also transparent...) texture is selected with texture's scaling factor of 2.

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise a color as set via the IRIT COLOR command is being used if set.

Example:


 attrib( tankBody, "rgb", "244,164,96" );


 

Index

NAME
Command line options
Usage
Advanced Usage

This document was created by man2html, using the manual pages.
Time: 07:27:21 GMT, October 17, 2022